home *** CD-ROM | disk | FTP | other *** search
/ Windows Game Programming for Dummies (2nd Edition) / WinGamProgFD.iso / pc / DirectX SDK / DXSDK / samples / Multimedia / VBSamples / DirectSound / EffectsBuffers / frmDistortion.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  2001-10-08  |  7.1 KB  |  234 lines

  1. VERSION 5.00
  2. Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
  3. Begin VB.Form frmDistortion 
  4.    BorderStyle     =   4  'Fixed ToolWindow
  5.    Caption         =   "Distortion Effects Update"
  6.    ClientHeight    =   3240
  7.    ClientLeft      =   45
  8.    ClientTop       =   285
  9.    ClientWidth     =   2775
  10.    LinkTopic       =   "Form1"
  11.    MaxButton       =   0   'False
  12.    MinButton       =   0   'False
  13.    ScaleHeight     =   3240
  14.    ScaleWidth      =   2775
  15.    ShowInTaskbar   =   0   'False
  16.    StartUpPosition =   1  'CenterOwner
  17.    Begin VB.CommandButton cmdOK 
  18.       Caption         =   "OK"
  19.       Height          =   315
  20.       Left            =   1800
  21.       TabIndex        =   10
  22.       Top             =   2820
  23.       Width           =   915
  24.    End
  25.    Begin MSComctlLib.Slider sldGain 
  26.       Height          =   195
  27.       Left            =   60
  28.       TabIndex        =   0
  29.       Top             =   300
  30.       Width           =   2655
  31.       _ExtentX        =   4683
  32.       _ExtentY        =   344
  33.       _Version        =   393216
  34.       LargeChange     =   10
  35.       Min             =   -60
  36.       Max             =   0
  37.       TickFrequency   =   5
  38.    End
  39.    Begin MSComctlLib.Slider sldEdge 
  40.       Height          =   195
  41.       Left            =   60
  42.       TabIndex        =   1
  43.       Top             =   840
  44.       Width           =   2655
  45.       _ExtentX        =   4683
  46.       _ExtentY        =   344
  47.       _Version        =   393216
  48.       LargeChange     =   10
  49.       Max             =   100
  50.       TickFrequency   =   5
  51.    End
  52.    Begin MSComctlLib.Slider sldPostEQCenter 
  53.       Height          =   195
  54.       Left            =   60
  55.       TabIndex        =   2
  56.       Top             =   1380
  57.       Width           =   2655
  58.       _ExtentX        =   4683
  59.       _ExtentY        =   344
  60.       _Version        =   393216
  61.       LargeChange     =   500
  62.       SmallChange     =   100
  63.       Min             =   100
  64.       Max             =   8000
  65.       SelStart        =   100
  66.       TickFrequency   =   500
  67.       Value           =   100
  68.    End
  69.    Begin MSComctlLib.Slider sldPostEQBand 
  70.       Height          =   195
  71.       Left            =   60
  72.       TabIndex        =   3
  73.       Top             =   1920
  74.       Width           =   2655
  75.       _ExtentX        =   4683
  76.       _ExtentY        =   344
  77.       _Version        =   393216
  78.       LargeChange     =   500
  79.       SmallChange     =   100
  80.       Min             =   100
  81.       Max             =   8000
  82.       SelStart        =   100
  83.       TickFrequency   =   500
  84.       Value           =   100
  85.    End
  86.    Begin MSComctlLib.Slider sldPreLow 
  87.       Height          =   195
  88.       Left            =   60
  89.       TabIndex        =   4
  90.       Top             =   2460
  91.       Width           =   2655
  92.       _ExtentX        =   4683
  93.       _ExtentY        =   344
  94.       _Version        =   393216
  95.       LargeChange     =   500
  96.       SmallChange     =   100
  97.       Min             =   100
  98.       Max             =   8000
  99.       SelStart        =   100
  100.       TickFrequency   =   500
  101.       Value           =   100
  102.    End
  103.    Begin VB.Label lbl 
  104.       BackStyle       =   0  'Transparent
  105.       Caption         =   "Post EQ Bandwith"
  106.       Height          =   255
  107.       Index           =   4
  108.       Left            =   60
  109.       TabIndex        =   9
  110.       Top             =   1680
  111.       Width           =   2055
  112.    End
  113.    Begin VB.Label lbl 
  114.       BackStyle       =   0  'Transparent
  115.       Caption         =   "Post EQ Center Frequency"
  116.       Height          =   255
  117.       Index           =   3
  118.       Left            =   60
  119.       TabIndex        =   8
  120.       Top             =   1140
  121.       Width           =   2475
  122.    End
  123.    Begin VB.Label lbl 
  124.       BackStyle       =   0  'Transparent
  125.       Caption         =   "Edge"
  126.       Height          =   255
  127.       Index           =   0
  128.       Left            =   60
  129.       TabIndex        =   7
  130.       Top             =   600
  131.       Width           =   735
  132.    End
  133.    Begin VB.Label lbl 
  134.       BackStyle       =   0  'Transparent
  135.       Caption         =   "Gain"
  136.       Height          =   255
  137.       Index           =   1
  138.       Left            =   60
  139.       TabIndex        =   6
  140.       Top             =   60
  141.       Width           =   735
  142.    End
  143.    Begin VB.Label lbl 
  144.       BackStyle       =   0  'Transparent
  145.       Caption         =   "Prelow Pass Cutoff"
  146.       Height          =   255
  147.       Index           =   2
  148.       Left            =   60
  149.       TabIndex        =   5
  150.       Top             =   2220
  151.       Width           =   2535
  152.    End
  153. Attribute VB_Name = "frmDistortion"
  154. Attribute VB_GlobalNameSpace = False
  155. Attribute VB_Creatable = False
  156. Attribute VB_PredeclaredId = True
  157. Attribute VB_Exposed = False
  158. Option Explicit
  159. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  160. '  Copyright (C) 1999-2001 Microsoft Corporation.  All Rights Reserved.
  161. '  File:       frmDistortion.frm
  162. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  163. Private oBuffer As DirectSoundSecondaryBuffer8
  164. Private mlIndex As Long
  165. Private oFX As DirectSoundFXDistortion8
  166. Private Sub SaveAllSettings()
  167.     Dim fxNew As DSFXDISTORTION
  168.     'Ok, save these new settings
  169.     'Set the new information up
  170.     With fxNew
  171.         .fEdge = CSng(sldEdge.Value)
  172.         .fGain = CSng(sldGain.Value)
  173.         .fPostEQBandwidth = CSng(sldPostEQBand.Value)
  174.         .fPostEQCenterFrequency = CSng(sldPostEQCenter.Value)
  175.         .fPreLowpassCutoff = CSng(sldPreLow.Value)
  176.     End With
  177.     'Now update the effect
  178.     oFX.SetAllParameters fxNew
  179. End Sub
  180. Private Sub cmdOK_Click()
  181.     SaveAllSettings
  182.     Unload Me
  183. End Sub
  184. Private Sub Form_Load()
  185.     Dim fxCurrent As DSFXDISTORTION
  186.     'Get the echo interface
  187.     Set oFX = oBuffer.GetObjectinPath(DSFX_STANDARD_DISTORTION, mlIndex, IID_DirectSoundFXDistortion)
  188.     'Get the current settings from it
  189.     fxCurrent = oFX.GetAllParameters
  190.     'Now put them out there
  191.     With fxCurrent
  192.         sldEdge.Value = CLng(.fEdge)
  193.         sldGain.Value = CLng(.fGain)
  194.         sldPostEQBand.Value = CLng(.fPostEQBandwidth)
  195.         sldPostEQCenter.Value = CLng(.fPostEQCenterFrequency)
  196.         sldPreLow.Value = CLng(.fPreLowpassCutoff)
  197.     End With
  198. End Sub
  199. Public Sub SetBuffer(oBuf As DirectSoundSecondaryBuffer8, Index As Long)
  200.     'Store the buffer and index
  201.     Set oBuffer = oBuf
  202.     mlIndex = Index
  203. End Sub
  204. Private Sub sldEdge_Change()
  205.     SaveAllSettings
  206. End Sub
  207. Private Sub sldEdge_Scroll()
  208.     SaveAllSettings
  209. End Sub
  210. Private Sub sldGain_Change()
  211.     SaveAllSettings
  212. End Sub
  213. Private Sub sldGain_Scroll()
  214.     SaveAllSettings
  215. End Sub
  216. Private Sub sldPostEQBand_Change()
  217.     SaveAllSettings
  218. End Sub
  219. Private Sub sldPostEQBand_Scroll()
  220.     SaveAllSettings
  221. End Sub
  222. Private Sub sldPostEQCenter_Change()
  223.     SaveAllSettings
  224. End Sub
  225. Private Sub sldPostEQCenter_Scroll()
  226.     SaveAllSettings
  227. End Sub
  228. Private Sub sldPreLow_Change()
  229.     SaveAllSettings
  230. End Sub
  231. Private Sub sldPreLow_Scroll()
  232.     SaveAllSettings
  233. End Sub
  234.